<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>传悦案例-详情页</title>
	<link rel="stylesheet" href="style/style.css">
	<script src="js/jquery.min.js"></script>
	<script>

		String.prototype.parseUrl = function(){
			if(this.indexOf("?") === -1){
				return {};
			}
			let result = {}
			this.slice(this.indexOf("?")+1).split("&").forEach(item=>{
				let arr = item.split("=");
				result[arr[0]] = arr[1]
			})
			return result;
		}


		$(function(){
			let id = location.href.parseUrl().id;
			$.ajax({
				url:"http://10.35.164.50:8080/getDetails",
				data:{
					id:id
				},
				success:function(data){
					var data = JSON.parse(data);
					$(".data-title").html(data.title)
					let tagList = data.tag.split(" ");
					tagList.forEach(item=>{
						$(`<li>${item}</li>`).appendTo($(".data-tag"))
					})
					$(".data-date").html(data.time)
					$(".text").html(`<p>
						<img src=images/${data.detailsImg}>
						${data.text}
					</p>`)
				}
			})

		})
	</script>
</head>
<body>
	<div class="top">
		<div class="content">
			<img src="images/logo.png" class="logo" alt="">
			<ul class="nav">
				<li><a href="#">网站首页</a></li>
				<li><a href="#">传悦资源</a></li>
				<li class="focus"><a href="list.html">传悦案例</a></li>
				<li><a href="#">传悦服务</a></li>
				<li><a href="#">解决方案</a></li>
				<li><a href="#">需求提交</a></li>
			</ul>
		</div>
	</div>
	
	<div class="content details">
		<h2 class="data-title"></h2>
		<div class="info">
			<span>标签：</span>
			<ul class="data-tag">
			</ul>
			<span class="fr data-date"></span>
		</div>


		<div class='text'>
			
		</div>


	</div>

	<div class="bottom">
		<div class="content">
			<img src="images/logo-bottom.png" class="bottom-logo" alt="">
			<ul class="bottom-nav">
               <li><a href="#">关于传悦</a></li>
               <li><a href="#">新闻动态</a></li>
               <li><a href="#">传悦观点</a></li>
               <li><a href="#">联系传悦</a></li>
               <li><a href="#">加入传悦</a></li>
               <li><a href="#">付款账户</a></li>
			</ul>
			<p>Copyright ©2013  创梦网络科技有限责任公司  ‖  传悦 Chnyoo.cn All Rights Reserved    京ICP备12005221号 </p>
		</div>
	</div>
</body>
</html>